package dto

// CreateOrganizationRequest 创建组织请求
type CreateOrganizationRequest struct {
	ParentID  uint   `json:"parentId" binding:"omitempty,gte=0"`
	OrgName   string `json:"orgName" binding:"required,max=100"`
	OrgCode   string `json:"orgCode" binding:"required,max=50"`
	OrgType   int    `json:"orgType" binding:"required"`
	OrgLevel  int    `json:"orgLevel" binding:"required"`
	ManagerID uint   `json:"managerId" binding:"omitempty"`
	Contact   string `json:"contact" binding:"omitempty,max=50"`
	Phone     string `json:"phone" binding:"omitempty,max=20"`
	Email     string `json:"email" binding:"omitempty,email,max=100"`
	Address   string `json:"address" binding:"omitempty,max=200"`
	Remark    string `json:"remark" binding:"omitempty,max=500"`
	OrderNum  int    `json:"orderNum" binding:"omitempty"`
	Status    int    `json:"status" binding:"required"`
}

// UpdateOrganizationRequest 更新组织请求
type UpdateOrganizationRequest struct {
	ParentID  uint   `json:"parentId" binding:"omitempty,gte=0"`
	OrgName   string `json:"orgName" binding:"required,max=100"`
	OrgCode   string `json:"orgCode" binding:"required,max=50"`
	OrgType   int    `json:"orgType" binding:"required"`
	OrgLevel  int    `json:"orgLevel" binding:"required"`
	ManagerID uint   `json:"managerId" binding:"omitempty"`
	Contact   string `json:"contact" binding:"omitempty,max=50"`
	Phone     string `json:"phone" binding:"omitempty,max=20"`
	Email     string `json:"email" binding:"omitempty,email,max=100"`
	Address   string `json:"address" binding:"omitempty,max=200"`
	Remark    string `json:"remark" binding:"omitempty,max=500"`
	OrderNum  int    `json:"orderNum" binding:"omitempty"`
	Status    int    `json:"status" binding:"required"`
}

// OrganizationResponse 组织响应
type OrganizationResponse struct {
	ID         uint                    `json:"id"`
	ParentID   uint                    `json:"parentId"`
	OrgName    string                  `json:"orgName"`
	OrgCode    string                  `json:"orgCode"`
	OrgType    int                     `json:"orgType"`
	OrgLevel   int                     `json:"orgLevel"`
	ManagerID  uint                    `json:"managerId"`
	Contact    string                  `json:"contact"`
	Phone      string                  `json:"phone"`
	Email      string                  `json:"email"`
	Address    string                  `json:"address"`
	Remark     string                  `json:"remark"`
	OrderNum   int                     `json:"orderNum"`
	Status     int                     `json:"status"`
	CreateTime string                  `json:"createTime"`
	UpdateTime string                  `json:"updateTime"`
	Children   []*OrganizationResponse `json:"children,omitempty"`
}

// OrganizationTree 组织树节点
type OrganizationTree struct {
	ID        uint               `json:"id"`
	ParentID  uint               `json:"parentId"`
	OrgName   string             `json:"orgName"`
	OrgCode   string             `json:"orgCode"`
	OrgType   int                `json:"orgType"`
	OrgLevel  int                `json:"orgLevel"`
	ManagerID uint               `json:"managerId"`
	Status    int                `json:"status"`
	OrderNum  int                `json:"orderNum"`
	Children  []OrganizationTree `json:"children"`
}
